#!/bin/bash
NET=192.168.20
USER=root
PASSWORD=000000

ssh-keygen -t rsa -y -P "" -f ~/.ssh/id_rsa 2>&1 >/dev/null

for i in $(seq 13 23);do
{
/usr/bin/expect <<-EOF
	spawn ssh-copy-id ${USER}@${NET}.$i
	expect {
		"yes/no" {send "yes\r";exp_continue}
		"*assword:" {send "${PASSWORD}\r"}
	}
	expect eof
	EOF
}
done
